home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / XpThemes T271749292001.psc / mdlMain.bas < prev    next >
Encoding:
BASIC Source File  |  2001-09-30  |  1.3 KB  |  33 lines

  1. Attribute VB_Name = "mdlMain"
  2. 'ThemeTest created by The KPD-Team
  3. 'Copyright (c) 2001, The KPD-Team
  4. 'Visit our site at http://www.allapi.net/
  5. 'or email us at KPDTeam@allapi.net
  6.  
  7. Private Type OSVERSIONINFO
  8.     dwOSVersionInfoSize As Long
  9.     dwMajorVersion As Long
  10.     dwMinorVersion As Long
  11.     dwBuildNumber As Long
  12.     dwPlatformId As Long
  13.     szCSDVersion As String * 128 ' Maintenance string for PSS usage
  14. End Type
  15. Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
  16. Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
  17. Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
  18. 'Returns True if themes are supported
  19. Public Function AreThemesSupported() As Boolean
  20.     Dim hLib As Long
  21.     hLib = LoadLibrary("uxtheme.dll")
  22.     If hLib <> 0 Then FreeLibrary hLib
  23.     AreThemesSupported = Not (hLib = 0)
  24. End Function
  25. 'Returns True if the current vwindows version is Windows NT 5.1
  26. Public Function IsWindowsXP() As Boolean
  27.     Dim OsInfo As OSVERSIONINFO
  28.     GetVersionEx OsInfo
  29.     If OsInfo.dwPlatformId = 2 Then 'It's NT
  30.         IsWindowsXP = (OsInfo.dwMajorVersion = 5 And OsInfo.dwMinorVersion = 1) 'Version 5.1
  31.     End If
  32. End Function
  33.